1 00:00:00,000 --> 00:00:15,000 This is Hacker Public Radio episode 3,812 for Tuesday, the 14th of March 2023. 2 00:00:15,000 --> 00:00:20,000 Today's show is entitled, he pause computer does nothing. 3 00:00:20,000 --> 00:00:25,000 It is hosted by Brian in Ohio and is about 25 minutes long. 4 00:00:25,000 --> 00:00:27,000 It carries a clean flag. 5 00:00:27,000 --> 00:00:34,000 The summary is, a Z80 no-op test. 6 00:00:42,000 --> 00:00:45,000 Hello Hacker Public Radio, Brian in Ohio here. 7 00:00:45,000 --> 00:00:51,000 I'm out from under my rock doing part 2 of the Z80 computer build. 8 00:00:51,000 --> 00:00:56,000 As you can tell by the title, today's show is, 9 00:00:56,000 --> 00:00:59,000 peepos computer doesn't nothing. 10 00:00:59,000 --> 00:01:03,000 What that means, of course, if you don't know peepos, that's me, 11 00:01:03,000 --> 00:01:07,000 who my two-year-old grandson calls me peepo. 12 00:01:07,000 --> 00:01:14,000 He's the impetus, the reason that I'm doing this project 13 00:01:14,000 --> 00:01:18,000 and chronicling it here on HPR. 14 00:01:18,000 --> 00:01:23,000 So that maybe one day in the future, he or turns out 15 00:01:23,000 --> 00:01:28,000 his brothers in the oven, or maybe his cousin who's also in the oven. 16 00:01:28,000 --> 00:01:32,000 Maybe one of those three, or maybe all three, 17 00:01:32,000 --> 00:01:35,000 or who knows, will someday in the future, 18 00:01:35,000 --> 00:01:40,000 one or all of those kids will hang out with their old grandpa 19 00:01:40,000 --> 00:01:46,000 and learn how a computer works by building one themselves. 20 00:01:46,000 --> 00:01:51,000 So here I am, learning to do myself beforehand, getting ready. 21 00:01:51,000 --> 00:01:57,000 And so, in the last episode, I put together the one piece of test equipment 22 00:01:57,000 --> 00:02:01,000 that I needed, which was a logic probe, because I'm going to 23 00:02:01,000 --> 00:02:07,000 initially spool up this Z80 system using the facilities of an Arduino 24 00:02:07,000 --> 00:02:11,000 mega board to emulate, rom, and ram, 25 00:02:11,000 --> 00:02:15,000 and also to provide that some test equipment, 26 00:02:15,000 --> 00:02:20,000 like a logic probe, so I can program the system 27 00:02:20,000 --> 00:02:24,000 when I provide the required things to see if it's up and running. 28 00:02:24,000 --> 00:02:30,000 And so what's required initially is some power, 29 00:02:30,000 --> 00:02:37,000 clock signal, and some data. 30 00:02:37,000 --> 00:02:40,000 And the data I'm going to give it is, 31 00:02:40,000 --> 00:02:47,000 give the Z80 is provided by the Arduino mega board, 32 00:02:47,000 --> 00:02:52,000 which will be the machine code, which has the op code of zero. 33 00:02:52,000 --> 00:02:58,000 So the Z80 has about 180 instructions that it recognizes. 34 00:02:58,000 --> 00:03:04,000 They're all hexadecimal, coded, and it zero zero 35 00:03:04,000 --> 00:03:07,000 to the processor when it sees that. 36 00:03:07,000 --> 00:03:12,000 That's a no-op, it means do nothing and move on to the next instruction. 37 00:03:12,000 --> 00:03:17,000 And in this case, because the address lines aren't going to be hooked up to anything, 38 00:03:17,000 --> 00:03:21,000 they're not hooked up to any memory, it's just going to 39 00:03:21,000 --> 00:03:25,000 think that it's gone from one memory location to another, 40 00:03:25,000 --> 00:03:28,000 and it's just going to find another no-op. 41 00:03:28,000 --> 00:03:30,000 And so that's why this is called the no-op test. 42 00:03:30,000 --> 00:03:33,000 You're just getting the computer up and running, 43 00:03:33,000 --> 00:03:41,000 and having to do exactly nothing. 44 00:03:41,000 --> 00:03:45,000 So a couple things is to make sure just to clarify, 45 00:03:45,000 --> 00:03:50,000 I'm using an Arduino mega board, but it's not the Arduino environment. 46 00:03:50,000 --> 00:03:54,000 I'm running flash forth on it, and why would I use flash forth 47 00:03:54,000 --> 00:03:57,000 to do this instead of the Arduino environment, 48 00:03:57,000 --> 00:04:00,000 because flash forth is interactive. 49 00:04:00,000 --> 00:04:03,000 Without being a huge application in itself, 50 00:04:03,000 --> 00:04:07,000 there's other interactive languages that run on Arduino boards, 51 00:04:07,000 --> 00:04:09,000 things like circuit Python, 52 00:04:09,000 --> 00:04:15,000 but they're huge compared to the size of a fourth virtual machine. 53 00:04:15,000 --> 00:04:22,000 And also it's fourth is really geared towards manipulating things 54 00:04:22,000 --> 00:04:28,000 at the bare metal level, being able to dig into the registers 55 00:04:28,000 --> 00:04:34,000 and control whatever computer it's on at a very foundational level 56 00:04:34,000 --> 00:04:38,000 without any abstraction layers in between, 57 00:04:38,000 --> 00:04:43,000 except the ones you build yourselves by defining words. 58 00:04:43,000 --> 00:04:46,000 And why am I using them? 59 00:04:46,000 --> 00:04:49,000 They are doing a mega board instead of the Arduino unabored. 60 00:04:49,000 --> 00:04:51,000 It's because they're doing them, or yeah, 61 00:04:51,000 --> 00:04:54,000 instead of which has the mega 328 chip, 62 00:04:54,000 --> 00:04:57,000 and then has to do with the fact that the Arduino mega board 63 00:04:57,000 --> 00:04:59,000 has oooles and oooles of IO. 64 00:04:59,000 --> 00:05:02,000 It's got tons of ports, tons of available ports 65 00:05:02,000 --> 00:05:08,000 that I can manipulate to interact with the ZAD chip. 66 00:05:08,000 --> 00:05:15,000 It should be a snap to do it with this board. 67 00:05:15,000 --> 00:05:17,000 So the micro control board, like I said, 68 00:05:17,000 --> 00:05:20,000 is going to give the five volts the clock signal 69 00:05:20,000 --> 00:05:22,000 and the data to get the ZAD up and running. 70 00:05:22,000 --> 00:05:24,000 It's also going to provide the logic probe 71 00:05:24,000 --> 00:05:27,000 so we can test to see that it is running. 72 00:05:27,000 --> 00:05:34,000 So I wired up a probe shield that plugged into the board. 73 00:05:34,000 --> 00:05:37,000 First thing I did, and I've got pictures in the show notes 74 00:05:37,000 --> 00:05:42,000 to show all this stuff, is I hot glue to solder the spread board 75 00:05:42,000 --> 00:05:46,000 onto the Arduino mega probe shield, and then I plugged in the ZAD 76 00:05:46,000 --> 00:05:52,000 and the first wire that's shown by itself is a white wire 77 00:05:52,000 --> 00:05:56,000 that's the actual logic probe, that's from the last episode. 78 00:05:56,000 --> 00:06:01,000 I can plug that in onto the different pins of ZAD 79 00:06:01,000 --> 00:06:04,000 and see if things are happening or not. 80 00:06:04,000 --> 00:06:08,000 The next picture just shows power and brown being connected. 81 00:06:08,000 --> 00:06:12,000 I've split the power wire so I can have a rudimentary on-off switch. 82 00:06:12,000 --> 00:06:15,000 The next picture, there's a picture number 3 83 00:06:15,000 --> 00:06:19,000 with the blue wire that's a clock signal. 84 00:06:19,000 --> 00:06:27,000 And then the next one picture number 4 has got the show's yellow lines 85 00:06:27,000 --> 00:06:29,000 that are the control lines. 86 00:06:29,000 --> 00:06:33,000 The interrupt, the non-masculine interrupt, the white signal, 87 00:06:33,000 --> 00:06:36,000 the bus request and the reset signals. 88 00:06:36,000 --> 00:06:40,000 Those are all signals that are input to the ZAD 89 00:06:40,000 --> 00:06:43,000 to help control what's going on. 90 00:06:43,000 --> 00:06:46,000 Then orange wires are all the data bus. 91 00:06:46,000 --> 00:06:50,000 They go up to port A on the Arduino mega board. 92 00:06:50,000 --> 00:06:58,000 And the address lines then are, I put a little silver dot on the chip 93 00:06:58,000 --> 00:07:00,000 to show where pin 1 is. 94 00:07:00,000 --> 00:07:04,000 And so from where the clock chip is, which is pin 6, 95 00:07:04,000 --> 00:07:12,000 up and around clock wise, those unconnected pins are on the ZAD chip 96 00:07:12,000 --> 00:07:16,000 or all address lines. 97 00:07:16,000 --> 00:07:21,000 And the one that we're most interested in is the one at A0, 98 00:07:21,000 --> 00:07:25,000 which is next to the ground line, next to that black wire. 99 00:07:25,000 --> 00:07:28,000 And that's the one we'll be probing once we start this 100 00:07:28,000 --> 00:07:36,000 because what's as the ZAD goes through memory space, 101 00:07:36,000 --> 00:07:39,000 it's going to put each individual starting at zero 102 00:07:39,000 --> 00:07:44,000 and working up all the way up to 65,000 103 00:07:44,000 --> 00:07:47,000 binary 16-bit data addresses. 104 00:07:47,000 --> 00:07:51,000 And so that pin should be cycling between zero 105 00:07:51,000 --> 00:07:54,000 and one the most of all those pins. 106 00:07:54,000 --> 00:07:56,000 And so if I see activity on that pin, 107 00:07:56,000 --> 00:08:01,000 then I'm pretty confident that the chip is up and running. 108 00:08:01,000 --> 00:08:09,000 Now, so that's the hardware side of the test we're going to do today. 109 00:08:09,000 --> 00:08:14,000 On the software side, I fixed some of the fourth words 110 00:08:14,000 --> 00:08:18,000 in the last code that I presented in the last episode. 111 00:08:18,000 --> 00:08:21,000 It's kind of good HPR as a, it's always, 112 00:08:21,000 --> 00:08:24,000 it's good, it helps you to, when you post something 113 00:08:24,000 --> 00:08:28,000 and then even after the fact that I was looking at over and I saw 114 00:08:28,000 --> 00:08:32,000 that I made some mistakes and I refactored some of the words 115 00:08:32,000 --> 00:08:35,000 broken apart and I defined some new words, 116 00:08:35,000 --> 00:08:38,000 and that listing is in the show notes too. 117 00:08:38,000 --> 00:08:43,000 And so the fix I made was that the data processing word 118 00:08:43,000 --> 00:08:47,000 as defined was getting, 119 00:08:47,000 --> 00:08:52,000 when it, to sense that it was a static either higher or low signal, 120 00:08:52,000 --> 00:08:54,000 it was probing the wrong point. 121 00:08:54,000 --> 00:08:59,000 It was probing the output of pin H3 digital, 122 00:08:59,000 --> 00:09:04,000 six I think it is on the digital six on the, 123 00:09:04,000 --> 00:09:09,000 on the, on the, are doing a megabord. 124 00:09:09,000 --> 00:09:11,000 And what I really wanted to, you see, 125 00:09:11,000 --> 00:09:14,000 look at what was the input into pin E, 126 00:09:14,000 --> 00:09:16,000 the logic probe that, that white wire. 127 00:09:16,000 --> 00:09:18,000 So I changed that. 128 00:09:18,000 --> 00:09:26,000 I changed the, the output there too on the data processing word. 129 00:09:26,000 --> 00:09:29,000 I really don't care what frequency it is. 130 00:09:29,000 --> 00:09:33,000 So I just changed the word to, to just output if it's pulsing 131 00:09:33,000 --> 00:09:38,000 or just say it's pulsing, just put on the serial terminal pulse, 132 00:09:38,000 --> 00:09:40,000 the word pulse. 133 00:09:40,000 --> 00:09:44,000 Because I'm not interested in specific frequencies. 134 00:09:44,000 --> 00:09:48,000 I just put the clock in the logic and knit words, 135 00:09:48,000 --> 00:09:52,000 so that I can initialize the clock registers 136 00:09:52,000 --> 00:09:56,000 and on the, on the AVR chip. 137 00:09:56,000 --> 00:10:00,000 And I could, and the same for the logic probe, just, 138 00:10:00,000 --> 00:10:02,000 split in two words. 139 00:10:02,000 --> 00:10:05,000 I added some words to control the reset line. 140 00:10:05,000 --> 00:10:07,000 Those words are reset and run. 141 00:10:07,000 --> 00:10:13,000 Reset takes the, the pin, the reset pin from a high level state, 142 00:10:13,000 --> 00:10:17,000 which is in the run mode, and takes it to a low level state. 143 00:10:17,000 --> 00:10:21,000 So almost all control signals on the Z80 are active low. 144 00:10:21,000 --> 00:10:25,000 So when they're driven to ground, driven to zero voltage, 145 00:10:25,000 --> 00:10:29,000 they become active and do what they're supposed to do. 146 00:10:29,000 --> 00:10:33,000 So when you take the reset line and, and drive it to ground, 147 00:10:33,000 --> 00:10:37,000 then the, the chip is, is in a reset mode. 148 00:10:37,000 --> 00:10:42,000 And I added one more to, to be able to single step the clock. 149 00:10:42,000 --> 00:10:47,000 So I can, I can start and stop the clock with those words, 150 00:10:47,000 --> 00:10:49,000 start clock and stop clock. 151 00:10:49,000 --> 00:10:52,000 And I can change the frequency of the clock by, by, 152 00:10:52,000 --> 00:10:57,000 putting a number and, and then, calling the words set frequency. 153 00:10:57,000 --> 00:11:02,000 But I also wanted to be able to single step the, the, the, the, 154 00:11:02,000 --> 00:11:04,000 the Z80 chip. 155 00:11:04,000 --> 00:11:08,000 So that, we can probe around and look to see some other signals 156 00:11:08,000 --> 00:11:13,000 to see what's happening because the, the, like all computers, 157 00:11:13,000 --> 00:11:17,000 this Z80 has a very systematic way of functioning. 158 00:11:17,000 --> 00:11:21,000 And what it does is it, it, initially, it reads in from the data, 159 00:11:21,000 --> 00:11:26,000 looking, looks for, and it, it, and it interprets that first bit of data 160 00:11:26,000 --> 00:11:29,000 as, um, as some kind of instruction. 161 00:11:29,000 --> 00:11:31,000 And then if that instruction needs more data, 162 00:11:31,000 --> 00:11:34,000 it goes and fetches it, and then it processes it. 163 00:11:34,000 --> 00:11:39,000 And so the, you can, there's different signals that come alive in that process 164 00:11:39,000 --> 00:11:43,000 because each instruction for the Z80 takes between, 165 00:11:43,000 --> 00:11:46,000 I think it's like four in 20 clock cycles, 166 00:11:46,000 --> 00:11:50,000 depending on how long and how much data it needs. 167 00:11:50,000 --> 00:11:54,000 Um, so we, I've got the, uh, to, uh, 168 00:11:54,000 --> 00:11:57,000 I guess, uh, enough explanation I can do the test here. 169 00:11:57,000 --> 00:12:00,000 I've got the board plugged in. 170 00:12:00,000 --> 00:12:04,000 I've got, um, and I've got my serial term. 171 00:12:04,000 --> 00:12:08,000 I've got a, a little, uh, a serial term with serial terminal 172 00:12:08,000 --> 00:12:11,000 with a flash forth running at the flash forth prompt. 173 00:12:11,000 --> 00:12:14,000 And the first thing I'll do is I'll, uh, 174 00:12:14,000 --> 00:12:19,000 get the logic probe up and running by typing the word, um, 175 00:12:19,000 --> 00:12:23,000 logic probe, uh, in it. 176 00:12:23,000 --> 00:12:25,000 And why do that? 177 00:12:25,000 --> 00:12:27,000 It says, okay. 178 00:12:27,000 --> 00:12:32,000 Uh, and then I, uh, I'm going to, um, 179 00:12:32,000 --> 00:12:36,000 get the microtr, controller boards set up the ports on it. 180 00:12:36,000 --> 00:12:40,000 So that's, um, going to be, uh, 181 00:12:40,000 --> 00:12:43,000 let me look at my code. 182 00:12:43,000 --> 00:12:45,000 I can't remember exactly. 183 00:12:45,000 --> 00:12:47,000 Oh, Z80 ports in it. 184 00:12:47,000 --> 00:12:49,000 Basically what this does is it sets up those, 185 00:12:49,000 --> 00:12:52,000 those interconnections between the Z80 and the, 186 00:12:52,000 --> 00:12:55,000 and the, are doing a mega board up with all those wires. 187 00:12:55,000 --> 00:12:57,000 It, all those things that it's connected to, 188 00:12:57,000 --> 00:12:59,000 it's setting up them, them up correctly 189 00:12:59,000 --> 00:13:02,000 as either inputs or output ports. 190 00:13:02,000 --> 00:13:05,000 And so that is the word, 191 00:13:05,000 --> 00:13:10,000 Z80 ports in, uh, in it. 192 00:13:10,000 --> 00:13:13,000 And hit that, it's okay. 193 00:13:13,000 --> 00:13:18,000 And then, um, now add some power to the Z80 chip. 194 00:13:18,000 --> 00:13:24,000 And so I just, uh, plugged in five volts on the board. 195 00:13:24,000 --> 00:13:27,000 And now I should be able to, uh, 196 00:13:27,000 --> 00:13:29,000 the clock should be started. 197 00:13:29,000 --> 00:13:33,000 So I should be able to take my white logic probe 198 00:13:33,000 --> 00:13:35,000 and put it where the blue wire is. 199 00:13:35,000 --> 00:13:38,000 And I should be able to type the word sample in. 200 00:13:38,000 --> 00:13:41,000 And I'm expecting to see the word pulse output. 201 00:13:41,000 --> 00:13:42,000 And I do. 202 00:13:42,000 --> 00:13:45,000 And I can double check that that's actually working. 203 00:13:45,000 --> 00:13:47,000 I can go stop clock. 204 00:13:47,000 --> 00:13:50,000 Uh, 205 00:13:50,000 --> 00:13:54,000 this is the way I'm going to stop the clock. 206 00:13:54,000 --> 00:13:58,000 And now I'm going to do another sample of it of the pin. 207 00:13:58,000 --> 00:14:02,000 And, um, I'm in the wrong place. 208 00:14:02,000 --> 00:14:05,000 It's, uh, 209 00:14:05,000 --> 00:14:07,000 let's see here. 210 00:14:15,000 --> 00:14:17,000 Put this in to the right place. 211 00:14:17,000 --> 00:14:19,000 There you go. 212 00:14:19,000 --> 00:14:22,000 I should be able to get, um, 213 00:14:22,000 --> 00:14:24,000 let's see here. 214 00:14:24,000 --> 00:14:26,000 Seven. 215 00:14:30,000 --> 00:14:32,000 Okay, so I, uh, 216 00:14:32,000 --> 00:14:35,000 I had to, I never initialize the clock. 217 00:14:35,000 --> 00:14:37,000 I never typed in clock in it. 218 00:14:37,000 --> 00:14:39,000 So now I typed in clock in it, 219 00:14:39,000 --> 00:14:40,000 which, uh, 220 00:14:40,000 --> 00:14:42,000 initializes the clock. 221 00:14:42,000 --> 00:14:44,000 And now I can, uh, 222 00:14:44,000 --> 00:14:46,000 I can, um, 223 00:14:46,000 --> 00:14:49,000 I can, uh, 224 00:14:49,000 --> 00:14:50,000 start the clock. 225 00:14:50,000 --> 00:14:52,000 And I can sample. 226 00:14:52,000 --> 00:14:54,000 And, oops, 227 00:14:54,000 --> 00:14:55,000 different type quickly. 228 00:14:55,000 --> 00:14:56,000 Sample. 229 00:14:56,000 --> 00:14:57,000 It comes out pulse. 230 00:14:57,000 --> 00:15:01,000 And then I can stop the clock. 231 00:15:01,000 --> 00:15:03,000 And I can sample. 232 00:15:03,000 --> 00:15:05,000 And now it shows that it's a low. 233 00:15:05,000 --> 00:15:06,000 It's, it's not pulsing. 234 00:15:06,000 --> 00:15:08,000 It's a low signal. 235 00:15:08,000 --> 00:15:10,000 And I can start the clock again. 236 00:15:10,000 --> 00:15:12,000 And now, 237 00:15:12,000 --> 00:15:15,000 the next thing to probe is I'm going to take a, 238 00:15:15,000 --> 00:15:20,000 the logic probe wire that went wire out for more of the clock is the blue line. 239 00:15:20,000 --> 00:15:23,000 And I'm going to put it over in the A0 not line, 240 00:15:23,000 --> 00:15:29,000 which is that, that empty pin right next to the ground wire. 241 00:15:29,000 --> 00:15:32,000 And I'm going to, uh, 242 00:15:32,000 --> 00:15:34,000 sample there. 243 00:15:34,000 --> 00:15:38,000 And I need, and I get a high signal. 244 00:15:38,000 --> 00:15:42,000 So what I need to do is I need to properly reset the, 245 00:15:42,000 --> 00:15:46,000 the, the board, which I'll just type in the words reset and run. 246 00:15:46,000 --> 00:15:51,000 And then I should be able to sample. 247 00:15:51,000 --> 00:15:52,000 And I get a pulse. 248 00:15:52,000 --> 00:15:56,000 So the, so on the A0 pin, it's pulsing. 249 00:15:56,000 --> 00:16:00,000 And if I stop the clock. 250 00:16:00,000 --> 00:16:02,000 Oops, stop. 251 00:16:02,000 --> 00:16:05,000 If I type it correctly. 252 00:16:05,000 --> 00:16:07,000 Stop the clock. 253 00:16:07,000 --> 00:16:10,000 And now I sample. 254 00:16:10,000 --> 00:16:14,000 It's just a high because it's not, um, 255 00:16:14,000 --> 00:16:16,000 the clock stopped and you need a, 256 00:16:16,000 --> 00:16:18,000 a functioning clock for it to work. 257 00:16:18,000 --> 00:16:22,000 Um, so that to me is a good, uh, 258 00:16:22,000 --> 00:16:26,000 indication that the Z80 chip is, uh, 259 00:16:26,000 --> 00:16:28,000 behaving properly that it's, um, 260 00:16:28,000 --> 00:16:31,000 that the wiring and everything is connected correctly. 261 00:16:31,000 --> 00:16:33,000 And so now, uh, one other experiment, 262 00:16:33,000 --> 00:16:36,000 one other thing I can check is I can check the M1 line. 263 00:16:36,000 --> 00:16:40,000 M1 line is right next to the, um, 264 00:16:40,000 --> 00:16:43,000 well, I should make sure I've got, I've got a, 265 00:16:43,000 --> 00:16:46,000 uh, image of the, um, 266 00:16:46,000 --> 00:16:50,000 of the, uh, 267 00:16:50,000 --> 00:16:54,000 got the image of the Z80 chip, 268 00:16:54,000 --> 00:16:58,000 the pin out of the chip in the show notes. 269 00:16:58,000 --> 00:17:02,000 And yeah, M1 is actually, um, 270 00:17:02,000 --> 00:17:04,000 right next to reset. 271 00:17:04,000 --> 00:17:06,000 So, whatever. 272 00:17:06,000 --> 00:17:10,000 So the, the, um, 273 00:17:10,000 --> 00:17:13,000 the way is this, the, 274 00:17:13,000 --> 00:17:16,000 the order of things that happen when the Z80, 275 00:17:16,000 --> 00:17:19,000 uh, starts functioning when you first reset it. 276 00:17:19,000 --> 00:17:22,000 So what happens is we bring power up. 277 00:17:22,000 --> 00:17:26,000 You reset the, the, the Z80 puts it in no good state. 278 00:17:26,000 --> 00:17:30,000 It puts the program counter to zero. 279 00:17:30,000 --> 00:17:35,000 It puts address zero on the address bus. 280 00:17:35,000 --> 00:17:38,000 And then it, it, uh, 281 00:17:38,000 --> 00:17:42,000 it then draws M1 low. 282 00:17:42,000 --> 00:17:44,000 And M1 is just a signal. 283 00:17:44,000 --> 00:17:47,000 It, it draws the M1 signal low. 284 00:17:47,000 --> 00:17:49,000 And that's the indication, 285 00:17:49,000 --> 00:17:52,000 and it's starting the first part of what they call a machine cycle. 286 00:17:52,000 --> 00:17:55,000 Machine cycle is everything it takes to complete, 287 00:17:55,000 --> 00:17:58,000 uh, to get us in instruction, 288 00:17:58,000 --> 00:18:01,000 whatever data needs, and then finish it. 289 00:18:01,000 --> 00:18:03,000 And then, and then, uh, 290 00:18:03,000 --> 00:18:05,000 uh, it signals all this by first off, 291 00:18:05,000 --> 00:18:08,000 bringing them the M1 line low. 292 00:18:08,000 --> 00:18:12,000 And so the way to check that that's actually happening 293 00:18:12,000 --> 00:18:14,000 is to go back to that, uh, 294 00:18:14,000 --> 00:18:16,000 the terminal, 295 00:18:16,000 --> 00:18:19,000 and the clock is right now stopped. 296 00:18:19,000 --> 00:18:21,000 So I'm, I'm not going to start the clock. 297 00:18:21,000 --> 00:18:23,000 I'm going to single step the clock. 298 00:18:23,000 --> 00:18:25,000 And what I'm going to do is I'm going to, 299 00:18:25,000 --> 00:18:28,000 uh, go back to reset. 300 00:18:28,000 --> 00:18:33,000 I'm going to single step the, um, 301 00:18:33,000 --> 00:18:39,000 uh, just step, sorry step. 302 00:18:39,000 --> 00:18:42,000 I'm a single step, and then sample the pin. 303 00:18:42,000 --> 00:18:44,000 And I should see it high. 304 00:18:44,000 --> 00:18:48,000 And I'll do that a couple times, um, 305 00:18:48,000 --> 00:18:52,000 because it takes three clock cycles 306 00:18:52,000 --> 00:18:56,000 for the chip to be properly reset. 307 00:18:56,000 --> 00:18:58,000 So here we go. 308 00:18:58,000 --> 00:19:01,000 I'll do that one more time. 309 00:19:01,000 --> 00:19:05,000 And now I'm going to put the reset line 310 00:19:05,000 --> 00:19:07,000 into the run mode. 311 00:19:07,000 --> 00:19:11,000 And now I'm going to single step again and sample. 312 00:19:11,000 --> 00:19:14,000 And the M1 signal pin is still high, 313 00:19:14,000 --> 00:19:16,000 that clock signal. 314 00:19:16,000 --> 00:19:19,000 And now one more clock signal. 315 00:19:19,000 --> 00:19:23,000 And now when low, it's the beginning of a machine cycle. 316 00:19:23,000 --> 00:19:26,000 And if I click clock at a couple of times, 317 00:19:26,000 --> 00:19:28,000 it'll go back to high. 318 00:19:28,000 --> 00:19:33,000 And so I know that the, the M1 signal is working. 319 00:19:33,000 --> 00:19:35,000 And so with the A, uh, 320 00:19:35,000 --> 00:19:39,000 the address zero pulsing, um, 321 00:19:39,000 --> 00:19:42,000 that it, that it has busy, that it has activity on the address bus. 322 00:19:42,000 --> 00:19:46,000 And with the M1 signal cycling the way it is, 323 00:19:46,000 --> 00:19:50,000 I'm pretty confident that, uh, this is the 80 chip is, is good. 324 00:19:50,000 --> 00:19:54,000 And that, uh, it was a good, uh, a good, uh, 325 00:19:54,000 --> 00:19:58,000 no optest for that, uh, for that chip. 326 00:19:58,000 --> 00:20:00,000 And so I think that, uh, covers, 327 00:20:00,000 --> 00:20:02,000 I'm going to look my notes here. 328 00:20:02,000 --> 00:20:06,000 Uh, uh, uh, uh. 329 00:20:06,000 --> 00:20:10,000 Yeah, um, oh, there was one more thing we can do. 330 00:20:10,000 --> 00:20:13,000 And, and then that'll, that'll be the end. 331 00:20:13,000 --> 00:20:17,000 The last, uh, the last, uh, 332 00:20:17,000 --> 00:20:19,000 the last signal to probe. 333 00:20:19,000 --> 00:20:23,000 And this one is going to be, uh, the halt signal. 334 00:20:23,000 --> 00:20:27,000 When the, uh, 335 00:20:27,000 --> 00:20:29,000 when the, uh, 336 00:20:29,000 --> 00:20:31,000 uh, 337 00:20:31,000 --> 00:20:33,000 Z80 interrupts, uh, 338 00:20:33,000 --> 00:20:36,000 when the Z80 encounters a halt signal, 339 00:20:36,000 --> 00:20:39,000 it actually halts this, the processor, 340 00:20:39,000 --> 00:20:44,000 and does no opts internally until it receives an interrupt signal. 341 00:20:44,000 --> 00:20:48,000 And the halt signal, again, is active, um, 342 00:20:48,000 --> 00:20:50,000 believe it's active low. 343 00:20:50,000 --> 00:20:55,000 Also, and it's on pin number 18 of the chip. 344 00:20:55,000 --> 00:20:58,000 So I'm going to put it with the logic probe into, 345 00:20:58,000 --> 00:21:02,000 pin 18, and, um, 346 00:21:02,000 --> 00:21:04,000 do the same exact process. 347 00:21:04,000 --> 00:21:06,000 I'm going to reset the chip. 348 00:21:06,000 --> 00:21:10,000 So, uh, start with, uh, by putting it in, 349 00:21:10,000 --> 00:21:12,000 I put it in reset. 350 00:21:12,000 --> 00:21:15,000 And then I will, um, 351 00:21:15,000 --> 00:21:18,000 cycle the clock, uh, 352 00:21:18,000 --> 00:21:22,000 and sample a few times here. 353 00:21:22,000 --> 00:21:25,000 And now this time what it's going to be different is I'm going to put 354 00:21:25,000 --> 00:21:33,000 the, uh, hex address of 76, hex 76 on the data bus. 355 00:21:33,000 --> 00:21:36,000 Uh, and so, so when I start, uh, 356 00:21:36,000 --> 00:21:38,000 when I start to run the program, 357 00:21:38,000 --> 00:21:42,000 instead of finding on the data bus at address zero, 358 00:21:42,000 --> 00:21:43,000 a, 359 00:21:43,000 --> 00:21:43,000 a, 360 00:21:43,000 --> 00:21:46,000 a machine instruction zero, 361 00:21:46,000 --> 00:21:49,000 it's going to, the Z80's going to find on the data bus, 362 00:21:49,000 --> 00:21:52,000 the machine instruction 76, which is halt. 363 00:21:52,000 --> 00:21:53,000 And when it does that, 364 00:21:53,000 --> 00:21:56,000 I should, we should see when I sample that pin, 365 00:21:56,000 --> 00:21:57,000 the, the halt signal, 366 00:21:57,000 --> 00:21:59,000 it should go low. 367 00:21:59,000 --> 00:22:00,000 So let's do that. 368 00:22:00,000 --> 00:22:01,000 Let's put, uh, 369 00:22:01,000 --> 00:22:04,000 76 into, um, 370 00:22:04,000 --> 00:22:05,000 um, 371 00:22:05,000 --> 00:22:06,000 the data port. 372 00:22:06,000 --> 00:22:10,000 And I do that by typing in 76 data, 373 00:22:10,000 --> 00:22:11,000 uh, 374 00:22:11,000 --> 00:22:12,000 dollar sign 76, 375 00:22:12,000 --> 00:22:15,000 which is the hex notation in fourth for hex numbers, 376 00:22:15,000 --> 00:22:17,000 dollar sign 76. 377 00:22:17,000 --> 00:22:19,000 And then the word data, 378 00:22:19,000 --> 00:22:20,000 which is the data port, 379 00:22:20,000 --> 00:22:22,000 and I'm going to do C store, 380 00:22:22,000 --> 00:22:24,000 which is C and an exclamation point. 381 00:22:24,000 --> 00:22:28,000 That'll store the number 76 onto the data port. 382 00:22:28,000 --> 00:22:31,000 And I got the wrong thing. 383 00:22:31,000 --> 00:22:32,000 What's it called? 384 00:22:32,000 --> 00:22:33,000 May I got the wrong word? 385 00:22:33,000 --> 00:22:34,000 The wrong thing. 386 00:22:34,000 --> 00:22:36,000 It's called, um, 387 00:22:36,000 --> 00:22:38,000 what's it called? 388 00:22:38,000 --> 00:22:40,000 Yeah. 389 00:22:40,000 --> 00:22:42,000 Oh, it's couples, 390 00:22:42,000 --> 00:22:43,000 uh, 391 00:22:43,000 --> 00:22:44,000 case sensitive, 392 00:22:44,000 --> 00:22:45,000 fourth is, 393 00:22:45,000 --> 00:22:47,000 this fourth is case sensitive. 394 00:22:47,000 --> 00:22:49,000 So 76, 395 00:22:49,000 --> 00:22:51,000 capital DATA, 396 00:22:51,000 --> 00:22:53,000 C store, 397 00:22:53,000 --> 00:22:55,000 uh, 398 00:22:55,000 --> 00:22:57,000 C store, 399 00:22:57,000 --> 00:22:58,000 the values, 400 00:22:58,000 --> 00:23:02,000 the hex values 76 into the data port. 401 00:23:02,000 --> 00:23:03,000 And I get OK. 402 00:23:03,000 --> 00:23:05,000 And now I'm going to, 403 00:23:05,000 --> 00:23:06,000 uh, 404 00:23:06,000 --> 00:23:07,000 sample, 405 00:23:07,000 --> 00:23:08,000 and, 406 00:23:08,000 --> 00:23:09,000 uh, 407 00:23:09,000 --> 00:23:10,000 step and sample, 408 00:23:10,000 --> 00:23:11,000 the clock. 409 00:23:11,000 --> 00:23:13,000 And because it's, 410 00:23:13,000 --> 00:23:14,000 it's nothing there. 411 00:23:14,000 --> 00:23:15,000 OK. 412 00:23:15,000 --> 00:23:16,000 Now I'm going to, 413 00:23:16,000 --> 00:23:17,000 put the, 414 00:23:17,000 --> 00:23:19,000 the Z80 into run mode. 415 00:23:19,000 --> 00:23:22,000 And now I'm going to step and sample. 416 00:23:22,000 --> 00:23:25,000 And do it a few times to, 417 00:23:25,000 --> 00:23:28,000 because it'll take about four or five or six to get there. 418 00:23:28,000 --> 00:23:29,000 And there are now, 419 00:23:29,000 --> 00:23:30,000 the, 420 00:23:30,000 --> 00:23:31,000 the pin, 421 00:23:31,000 --> 00:23:32,000 uh, 422 00:23:32,000 --> 00:23:33,000 20, 423 00:23:33,000 --> 00:23:35,000 the signal on pin, 424 00:23:35,000 --> 00:23:35,000 uh, 425 00:23:35,000 --> 00:23:38,000 18 went from high to low. 426 00:23:38,000 --> 00:23:39,000 And that to me, 427 00:23:39,000 --> 00:23:40,000 uh, 428 00:23:40,000 --> 00:23:42,000 because it found that 76 on the, 429 00:23:42,000 --> 00:23:43,000 uh, 430 00:23:43,000 --> 00:23:44,000 on the data bus, 431 00:23:44,000 --> 00:23:47,000 it executed the instruction halt. 432 00:23:47,000 --> 00:23:48,000 And now this, 433 00:23:48,000 --> 00:23:49,000 the, 434 00:23:49,000 --> 00:23:50,000 um, 435 00:23:50,000 --> 00:23:53,000 uh, 436 00:23:53,000 --> 00:23:54,000 the Z80 is in a halt mode. 437 00:23:54,000 --> 00:23:55,000 So if I, 438 00:23:55,000 --> 00:23:56,000 if I, 439 00:23:56,000 --> 00:23:57,000 if I start the clock now, 440 00:23:57,000 --> 00:24:00,000 I'm going to do a nice sample. 441 00:24:00,000 --> 00:24:02,000 It should stay low. 442 00:24:02,000 --> 00:24:03,000 It should stay low. 443 00:24:03,000 --> 00:24:04,000 It should stay low. 444 00:24:04,000 --> 00:24:05,000 The, 445 00:24:05,000 --> 00:24:06,000 now completely, 446 00:24:06,000 --> 00:24:08,000 and a little stay low until I reset it, 447 00:24:08,000 --> 00:24:09,000 uh, 448 00:24:09,000 --> 00:24:10,000 or give it an interrupt signal, 449 00:24:10,000 --> 00:24:11,000 which I'm not going to do. 450 00:24:11,000 --> 00:24:12,000 And so there we go. 451 00:24:12,000 --> 00:24:13,000 Uh, 452 00:24:13,000 --> 00:24:15,000 Looks like I've got a functioning, 453 00:24:15,000 --> 00:24:15,000 uh, 454 00:24:15,000 --> 00:24:17,000 good does the 80 chip. 455 00:24:17,000 --> 00:24:17,000 I, 456 00:24:17,000 --> 00:24:19,000 have learned a little bit. 457 00:24:19,000 --> 00:24:21,000 It's about how to, 458 00:24:21,000 --> 00:24:22,000 um, 459 00:24:22,000 --> 00:24:23,000 manipulate, 460 00:24:23,000 --> 00:24:24,000 and a couple of instructions, 461 00:24:24,000 --> 00:24:25,000 the no-op instruction, 462 00:24:25,000 --> 00:24:26,000 and the halt instruction, 463 00:24:26,000 --> 00:24:28,000 and put them on the data bus, 464 00:24:28,000 --> 00:24:29,000 and, 465 00:24:29,000 --> 00:24:30,000 and get the, 466 00:24:30,000 --> 00:24:31,000 uh, 467 00:24:31,000 --> 00:24:32,000 Z80 to respond accordingly. 468 00:24:32,000 --> 00:24:34,000 And I was able to, 469 00:24:34,000 --> 00:24:35,000 uh, 470 00:24:35,000 --> 00:24:36,000 um, 471 00:24:36,000 --> 00:24:38,000 see all those things by, 472 00:24:38,000 --> 00:24:40,000 using the logic probe that's, 473 00:24:40,000 --> 00:24:42,000 that it's built into the, 474 00:24:42,000 --> 00:24:44,000 software on the, 475 00:24:44,000 --> 00:24:45,000 our degree. 476 00:24:45,000 --> 00:24:46,000 So, 477 00:24:46,000 --> 00:24:49,000 consider, 478 00:24:49,000 --> 00:24:50,000 consider this, 479 00:24:50,000 --> 00:24:51,000 uh, 480 00:24:51,000 --> 00:24:52,000 a successful experiment. 481 00:24:52,000 --> 00:24:53,000 Um, 482 00:24:53,000 --> 00:24:54,000 I think, 483 00:24:54,000 --> 00:24:55,000 uh, 484 00:24:55,000 --> 00:24:56,000 I'm not sure where to go from here. 485 00:24:56,000 --> 00:24:58,000 I think the next thing to do would be to, 486 00:24:58,000 --> 00:24:59,000 maybe do a, 487 00:24:59,000 --> 00:25:00,000 a more, 488 00:25:00,000 --> 00:25:01,000 um, 489 00:25:01,000 --> 00:25:02,000 a more, 490 00:25:02,000 --> 00:25:04,000 a longer set of instructions, 491 00:25:04,000 --> 00:25:05,000 a small program, 492 00:25:05,000 --> 00:25:06,000 and, 493 00:25:06,000 --> 00:25:07,000 uh, 494 00:25:07,000 --> 00:25:08,000 maybe even, 495 00:25:08,000 --> 00:25:09,000 I might have to add some LEDs or something. 496 00:25:09,000 --> 00:25:10,000 We'll see, 497 00:25:10,000 --> 00:25:13,000 or at least put out some numbers on to the, 498 00:25:13,000 --> 00:25:14,000 serial ports, 499 00:25:14,000 --> 00:25:16,000 like we can see get some output that way. 500 00:25:16,000 --> 00:25:17,000 And, 501 00:25:17,000 --> 00:25:17,000 um, 502 00:25:17,000 --> 00:25:19,000 and that'll require emulating, 503 00:25:19,000 --> 00:25:20,000 emulating some RAM. 504 00:25:20,000 --> 00:25:21,000 I think I'm, 505 00:25:21,000 --> 00:25:21,000 excuse me, 506 00:25:21,000 --> 00:25:22,000 a ROM, 507 00:25:22,000 --> 00:25:24,000 emulating some read-only memory. 508 00:25:24,000 --> 00:25:25,000 So I'll be the next, 509 00:25:25,000 --> 00:25:26,000 uh, 510 00:25:26,000 --> 00:25:28,000 the next step in this project. 511 00:25:28,000 --> 00:25:29,000 So, 512 00:25:29,000 --> 00:25:29,000 um, 513 00:25:29,000 --> 00:25:30,000 thanks for listening. 514 00:25:30,000 --> 00:25:31,000 Um, 515 00:25:31,000 --> 00:25:33,000 if you have any questions or comments, 516 00:25:33,000 --> 00:25:35,000 go ahead and leave them in the show notes, 517 00:25:35,000 --> 00:25:36,000 or you can email me. 518 00:25:36,000 --> 00:25:37,000 And if you, 519 00:25:37,000 --> 00:25:38,000 um, 520 00:25:38,000 --> 00:25:40,000 or if you're interested in this project, 521 00:25:40,000 --> 00:25:42,000 and if you, um, 522 00:25:42,000 --> 00:25:43,000 or if you're interested in retro computers, 523 00:25:43,000 --> 00:25:45,000 or doing something like this yourself, 524 00:25:45,000 --> 00:25:46,000 uh, 525 00:25:46,000 --> 00:25:48,000 pick up a mic and start recording a show, 526 00:25:48,000 --> 00:25:50,000 and upload it to HackerPublicRadio. 527 00:25:50,000 --> 00:25:52,000 And, 528 00:25:52,000 --> 00:25:53,000 if you, 529 00:25:53,000 --> 00:25:54,000 um, 530 00:25:54,000 --> 00:25:55,000 and anyway, 531 00:25:55,000 --> 00:25:56,000 thanks for listening. 532 00:25:56,000 --> 00:25:58,000 I appreciate your attention. 533 00:25:58,000 --> 00:26:00,000 And I just like to remind everybody, 534 00:26:00,000 --> 00:26:03,000 that it's not how much an item costs. 535 00:26:03,000 --> 00:26:05,000 It's how much you save. 536 00:26:05,000 --> 00:26:06,000 Goodbye. 537 00:26:06,000 --> 00:26:13,000 You have been listening to HackerPublicRadio, 538 00:26:13,000 --> 00:26:15,000 at HackerPublicRadio.org. 539 00:26:15,000 --> 00:26:20,000 Today's show was contributed by a HPR listening like yourself, 540 00:26:20,000 --> 00:26:23,000 if you ever thought of recording podcast, 541 00:26:23,000 --> 00:26:27,000 and click on our contribute link to find out how easy it means. 542 00:26:27,000 --> 00:26:33,000 Hosting for HPR has been kindly provided by an onsthost.com, 543 00:26:33,000 --> 00:26:36,000 internet archive, and our Sync.net. 544 00:26:36,000 --> 00:26:38,000 On this otherwise stages, 545 00:26:38,000 --> 00:26:41,000 today's show is released on our Creative Commons, 546 00:26:41,000 --> 00:27:05,000 at Tribution, 4.0 International License.